import { RepoContentModel } from 'store/models/repoContent';

const filesSort = (a: RepoContentModel, b: RepoContentModel): 1 | -1 | 0 => {
    if (a.type === 'dir' && b.type !== 'dir') return -1;
    if (a.type !== 'dir' && b.type === 'dir') return 1;

    return a.name > b.name ? 1 : -1;
};

export default filesSort;
